<template>
    <el-table :data="tableData" stripe style="width: 100%">
        <el-table-column label="Goods">
            <template slot-scope="scope">
                <img :src="scope.row.picurl" alt="" height="100px" width="120px">
            </template>
        </el-table-column>
        <el-table-column prop="orderid" label="Order-ID"></el-table-column>
        <el-table-column prop="orderdate" label="Order-Date"></el-table-column>
        <el-table-column label="Address">
            <template slot-scope="scope">
                <span>{{scope.row.shipcountry}}  {{scope.row.shipcity}}  {{scope.row.shipaddr1}}</span>
            </template>
        </el-table-column>
        <el-table-column prop="shiptolastname" label="Accepter"></el-table-column>
        <el-table-column prop="quantity" label="Quantity"></el-table-column>
        <el-table-column prop="totalprice" label="Total-Price"></el-table-column>
        <el-table-column prop="status" label="Now-Status"></el-table-column>
    </el-table>
</template>

<script>
export default {
    name: 'orderTable',
    props:{
        status: [Number, String]
    },
    data() {
        return{
            tableData:[]
        }
    },
    mounted(){
        this.getData();
    },
    methods:{
        getData(){
            this.$Axios({
                method: 'get',
                url: '/order/orders/'+this.status,
            }).then(res=>{
                this.tableData = res.data.data
            }).catch(error=>{
                this.$message.error("其他服务器错误"+error)
            })
        }
    }
}
</script>